Integrand size = 23, antiderivative size = 62 \[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}} \]
arctanh(cos(f*x+e)*a^(1/2)/(a+a*sin(f*x+e))^(1/2))/f/a^(1/2)-cot(f*x+e)/f/ (a+a*sin(f*x+e))^(1/2)
Leaf count is larger than twice the leaf count of optimal. \(138\) vs. \(2(62)=124\).
Time = 0.53 (sec) , antiderivative size = 138, normalized size of antiderivative = 2.23 \[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {\csc \left (\frac {1}{4} (e+f x)\right ) \sec \left (\frac {1}{4} (e+f x)\right ) \left (-2 \cos \left (\frac {1}{2} (e+f x)\right )+2 \sin \left (\frac {1}{2} (e+f x)\right )+\left (\log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \sin (e+f x)\right ) \left (1+\tan \left (\frac {1}{2} (e+f x)\right )\right )}{8 f \sqrt {a (1+\sin (e+f x))}} \]
(Csc[(e + f*x)/4]*Sec[(e + f*x)/4]*(-2*Cos[(e + f*x)/2] + 2*Sin[(e + f*x)/ 2] + (Log[1 + Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] - Log[1 - Cos[(e + f*x) /2] + Sin[(e + f*x)/2]])*Sin[e + f*x])*(1 + Tan[(e + f*x)/2]))/(8*f*Sqrt[a *(1 + Sin[e + f*x])])
Time = 0.33 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3195, 27, 3042, 3252, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot ^2(e+f x)}{\sqrt {a \sin (e+f x)+a}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\tan (e+f x)^2 \sqrt {a \sin (e+f x)+a}}dx\) |
\(\Big \downarrow \) 3195 |
\(\displaystyle \frac {\int -\frac {1}{2} \csc (e+f x) \sqrt {\sin (e+f x) a+a}dx}{a}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle -\frac {\int \csc (e+f x) \sqrt {\sin (e+f x) a+a}dx}{2 a}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {\sqrt {\sin (e+f x) a+a}}{\sin (e+f x)}dx}{2 a}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}}\) |
\(\Big \downarrow \) 3252 |
\(\displaystyle \frac {\int \frac {1}{a-\frac {a^2 \cos ^2(e+f x)}{\sin (e+f x) a+a}}d\frac {a \cos (e+f x)}{\sqrt {\sin (e+f x) a+a}}}{f}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}}\) |
ArcTanh[(Sqrt[a]*Cos[e + f*x])/Sqrt[a + a*Sin[e + f*x]]]/(Sqrt[a]*f) - Cot [e + f*x]/(f*Sqrt[a + a*Sin[e + f*x]])
3.2.5.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)/tan[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> Simp[-(a + b*Sin[e + f*x])^m/(f*Tan[e + f*x]), x] + Simp[1/a Int[(a + b*Sin[e + f*x])^m*((b*m - a*(m + 1)*Sin[e + f*x])/Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m - 1 /2] && !LtQ[m, -1]
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + ( f_.)*(x_)]), x_Symbol] :> Simp[-2*(b/f) Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Time = 0.64 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.66
method | result | size |
default | \(-\frac {\left (\sin \left (f x +e \right )+1\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-\operatorname {arctanh}\left (\frac {\sqrt {a -a \sin \left (f x +e \right )}}{\sqrt {a}}\right ) a \sin \left (f x +e \right )+\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\right )}{a^{\frac {3}{2}} \sin \left (f x +e \right ) \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(103\) |
-(sin(f*x+e)+1)*(-a*(sin(f*x+e)-1))^(1/2)*(-arctanh((a-a*sin(f*x+e))^(1/2) /a^(1/2))*a*sin(f*x+e)+(a-a*sin(f*x+e))^(1/2)*a^(1/2))/a^(3/2)/sin(f*x+e)/ cos(f*x+e)/(a+a*sin(f*x+e))^(1/2)/f
Leaf count of result is larger than twice the leaf count of optimal. 263 vs. \(2 (54) = 108\).
Time = 0.31 (sec) , antiderivative size = 263, normalized size of antiderivative = 4.24 \[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {{\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} + 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) + 4 \, \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{4 \, {\left (a f \cos \left (f x + e\right )^{2} - a f - {\left (a f \cos \left (f x + e\right ) + a f\right )} \sin \left (f x + e\right )\right )}} \]
1/4*((cos(f*x + e)^2 - (cos(f*x + e) + 1)*sin(f*x + e) - 1)*sqrt(a)*log((a *cos(f*x + e)^3 - 7*a*cos(f*x + e)^2 + 4*(cos(f*x + e)^2 + (cos(f*x + e) + 3)*sin(f*x + e) - 2*cos(f*x + e) - 3)*sqrt(a*sin(f*x + e) + a)*sqrt(a) - 9*a*cos(f*x + e) + (a*cos(f*x + e)^2 + 8*a*cos(f*x + e) - a)*sin(f*x + e) - a)/(cos(f*x + e)^3 + cos(f*x + e)^2 + (cos(f*x + e)^2 - 1)*sin(f*x + e) - cos(f*x + e) - 1)) + 4*sqrt(a*sin(f*x + e) + a)*(cos(f*x + e) - sin(f*x + e) + 1))/(a*f*cos(f*x + e)^2 - a*f - (a*f*cos(f*x + e) + a*f)*sin(f*x + e))
\[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\int \frac {\cot ^{2}{\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \]
\[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\int { \frac {\cot \left (f x + e\right )^{2}}{\sqrt {a \sin \left (f x + e\right ) + a}} \,d x } \]
Leaf count of result is larger than twice the leaf count of optimal. 132 vs. \(2 (54) = 108\).
Time = 0.35 (sec) , antiderivative size = 132, normalized size of antiderivative = 2.13 \[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {\sqrt {2} \sqrt {a} {\left (\frac {\sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}\right )}{a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )}}{4 \, f} \]
1/4*sqrt(2)*sqrt(a)*(sqrt(2)*log(abs(-2*sqrt(2) + 4*sin(-1/4*pi + 1/2*f*x + 1/2*e))/abs(2*sqrt(2) + 4*sin(-1/4*pi + 1/2*f*x + 1/2*e)))/(a*sgn(cos(-1 /4*pi + 1/2*f*x + 1/2*e))) - 4*sin(-1/4*pi + 1/2*f*x + 1/2*e)/((2*sin(-1/4 *pi + 1/2*f*x + 1/2*e)^2 - 1)*a*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))))/f
Timed out. \[ \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\int \frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \]